﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Anay.TaskScheduling.Common
{
    public class ConfigFactory
    {

        private IConfigHelper configHelper = null;

        public ConfigFactory()
        {
            if (bool.Parse( System.Configuration.ConfigurationManager.AppSettings["isUseJson"] ))
            {
                configHelper = new ConfigJsonHelper();
            }
            else
            {
                configHelper = new ConfigDBHelper();
            }
        }

        public IConfigHelper GetInstance() {
            return configHelper;
        }
    }
}
